1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.eventbus;
18
19 import com.google.common.testing.AbstractPackageSanityTests;
20
21 import java.lang.reflect.Method;
22
23 import javax.annotation.Nullable;
24
25
26
27
28
29
30
31 public class PackageSanityTests extends AbstractPackageSanityTests {
32
33 public PackageSanityTests() throws Exception {
34 setDefault(EventSubscriber.class, new DummySubscriber().toEventSubscriber());
35 setDefault(Method.class, DummySubscriber.subscriberMethod());
36 }
37
38 private static class DummySubscriber {
39
40 @SuppressWarnings("unused")
41 public void handle(@Nullable Object anything) {}
42
43 EventSubscriber toEventSubscriber() throws Exception {
44 return new EventSubscriber(this, subscriberMethod());
45 }
46
47 private static Method subscriberMethod() throws NoSuchMethodException {
48 return DummySubscriber.class.getMethod("handle", Object.class);
49 }
50 }
51 }